import 'package:flutter/material.dart';
import 'package:garbage_classification/global.dart';

class ClassificationPage extends StatefulWidget {
  ClassificationPage({Key key}) : super(key: key);
  @override
  _ClassificationPageState createState() => _ClassificationPageState();
}

class _ClassificationPageState extends State<ClassificationPage> {
  @override
  void initState() {
    super.initState();
  }

  Widget list(String text, String type) {
    return Row(
      crossAxisAlignment: CrossAxisAlignment.center,
      mainAxisAlignment: MainAxisAlignment.start,
      children: [
        type != ''
            ? Container(
                child: Image.asset('assets/images/${type}_li.png'), width: 7)
            : Container(),
        type != '' ? SizedBox(width: 5) : Container(),
        Expanded(
          child: Text(
            text,
            style: TextStyle(
              color: Global.fontColor,
              fontSize: 10,
              fontWeight: FontWeight.w400,
            ),
          ),
        ),
        SizedBox(width: 15)
      ],
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        padding: EdgeInsets.only(top: Global.paddingTop + 10),
        width: MediaQuery.of(context).size.width,
        height: MediaQuery.of(context).size.height,
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          mainAxisAlignment: MainAxisAlignment.start,
          children: [
            Row(
              crossAxisAlignment: CrossAxisAlignment.center,
              mainAxisAlignment: MainAxisAlignment.start,
              children: [
                Container(
                  child: Image.asset('assets/images/hui.png', width: 120),
                ),
                Expanded(
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    mainAxisAlignment: MainAxisAlignment.start,
                    children: [
                      Text(
                        "可回收物",
                        style: TextStyle(
                          color: Color.fromRGBO(19, 139, 214, 1),
                          fontSize: 13,
                          fontWeight: FontWeight.w500,
                        ),
                      ),
                      list("废纸张、废塑料、废玻璃制品、废金属、废织物等适宜回收，可循环利用的生活废弃物。", ''),
                      Text(
                        "可回收物投放要求",
                        style: TextStyle(
                          color: Color.fromRGBO(19, 139, 214, 1),
                          fontSize: 13,
                          fontWeight: FontWeight.w500,
                        ),
                      ),
                      list("轻投轻放，清洁干燥，避免污染", 'hui'),
                      list("废纸尽量平整", 'hui'),
                      list("立体包装物请清空内容物，清洁后压扁投放", 'hui'),
                      list("有尖锐边角的，应包裹后投放", 'hui'),
                    ],
                  ),
                ),
              ],
            ),
            SizedBox(height: 15),
            Row(
              crossAxisAlignment: CrossAxisAlignment.center,
              mainAxisAlignment: MainAxisAlignment.start,
              children: [
                Container(
                  child: Image.asset('assets/images/shi.png', width: 120),
                ),
                Expanded(
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    mainAxisAlignment: MainAxisAlignment.start,
                    children: [
                      Text(
                        "湿垃圾",
                        style: TextStyle(
                          color: Color.fromRGBO(119, 91, 74, 1),
                          fontSize: 13,
                          fontWeight: FontWeight.w500,
                        ),
                      ),
                      list("即易腐垃圾，是指食材废料、剩菜剩饭、过期食品、瓜果皮核、花卉绿植、中药药渣等生物质，生活废弃物。",
                          ''),
                      Text(
                        "湿垃圾投放要求",
                        style: TextStyle(
                          color: Color.fromRGBO(119, 91, 74, 1),
                          fontSize: 13,
                          fontWeight: FontWeight.w500,
                        ),
                      ),
                      list("流质食物垃圾，如牛奶等，应直接倒入下水道", 'shi'),
                      list("有包装物的湿垃圾应将包装物去除后分类投放", 'shi'),
                      list("包装物请投放到对应的可回收物或干垃圾容器", 'shi'),
                    ],
                  ),
                ),
              ],
            ),
            SizedBox(height: 15),
            Row(
              crossAxisAlignment: CrossAxisAlignment.center,
              mainAxisAlignment: MainAxisAlignment.start,
              children: [
                Container(
                  child: Image.asset('assets/images/hai.png', width: 120),
                ),
                Expanded(
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    mainAxisAlignment: MainAxisAlignment.start,
                    children: [
                      Text(
                        "有害垃圾",
                        style: TextStyle(
                          color: Color.fromRGBO(232, 35, 16, 1),
                          fontSize: 13,
                          fontWeight: FontWeight.w500,
                        ),
                      ),
                      list("废电池、废灯管、废药品、废油漆及其容器对人体健康或者自然环境造成直接或者潜在危害的生活废弃物。",
                          ''),
                      Text(
                        "有害垃圾投放要求",
                        style: TextStyle(
                          color: Color.fromRGBO(232, 35, 16, 1),
                          fontSize: 13,
                          fontWeight: FontWeight.w500,
                        ),
                      ),
                      list("投放时请注意轻放", 'hai'),
                      list("已破损的请连带包装或包裹后投放", 'hai'),
                      list("如易挥发，请密封后投放", 'hai'),
                    ],
                  ),
                ),
              ],
            ),
            SizedBox(height: 15),
            Row(
              crossAxisAlignment: CrossAxisAlignment.center,
              mainAxisAlignment: MainAxisAlignment.start,
              children: [
                Container(
                  child: Image.asset('assets/images/gan.png', width: 120),
                ),
                Expanded(
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    mainAxisAlignment: MainAxisAlignment.start,
                    children: [
                      Text(
                        "干垃圾",
                        style: TextStyle(
                          color: Color.fromRGBO(114, 114, 114, 1),
                          fontSize: 13,
                          fontWeight: FontWeight.w500,
                        ),
                      ),
                      list("即其他垃圾，是指除可回收物、有害垃圾、湿垃圾意外的其他生活垃圾", ''),
                      Text(
                        "干垃圾投放要求",
                        style: TextStyle(
                          color: Color.fromRGBO(114, 114, 114, 1),
                          fontSize: 13,
                          fontWeight: FontWeight.w500,
                        ),
                      ),
                      list("尽量沥干水分", 'gan'),
                      list("难以辨别类别的生活垃圾投入到干垃圾容器内", 'gan'),
                    ],
                  ),
                ),
              ],
            ),
          ],
        ),
      ),
    );
  }
}
